package com.glsc.ngateway.common.base.domain.mysql.opmanagemain.log;

import java.time.LocalDateTime;

import javax.persistence.*;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.glsc.ngateway.common.api.common.enums.DictConstant;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.DateSerializer;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * @author houzhc
 * @description: TODO hzc
 * @date 2024年06月24日
 */
@Data
@Accessors(chain = true)
@Entity
@Table(name = "t_xinyi_log")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class XinYiLog {

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "request_id")
    private String requestId;

    @Column(name = "workflow_id")
    private String workflowId;

    @Column(name = "detail_id", columnDefinition = "varchar(255) COMMENT 'oa的detail中的id'")
    private String detailId;

    @Column(name = "param")
    private String param;

    @Column(name = "result")
    private String result;

    @ApiModelProperty(value = "创建时间 yyyy-MM-dd HH:mm:ss")
    @Column(name = "create_time", columnDefinition = "datetime comment '创建时间'", updatable = false)
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime createTime;

    @Column(name = "update_time", updatable = false)
    @UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "是否触发新意成功，字典 YesNo:（N=失败 Y=成功)")
    @Column(name = "status", columnDefinition = "varchar(20) default 'N' COMMENT '是否触发新意成功，字典 YesNo:（N=失败 Y=成功)'")
    private String status = DictConstant.YES;

    @ApiModelProperty(value = "oa名称")
    @Column(name = "oa_flow_name", columnDefinition = "varchar(255) COMMENT 'oa名称'")
    private String oaFlowName;

    @ApiModelProperty(value = "收款银行账号")
    @Column(name = "rec_bank_acc", columnDefinition = "varchar(255) COMMENT '收款银行账号'")
    private String recBankAcc;

    @ApiModelProperty(value = "收款银行账号名称")
    @Column(name = "rec_bank_acc_name", columnDefinition = "varchar(255) COMMENT '收款银行账号名称'")
    private String recBankAccName;

    @ApiModelProperty(value = "付款银行账号")
    @Column(name = "pay_bank_acc", columnDefinition = "varchar(255) COMMENT '付款银行账号'")
    private String payBankAcc;

    @ApiModelProperty(value = "付款银行账号名称")
    @Column(name = "pay_bank_acc_name", columnDefinition = "varchar(255) COMMENT '付款银行账号名称'")
    private String payBankAccName;

    @ApiModelProperty(value = "备注")
    @Column(name = "memo", columnDefinition = "varchar(255) COMMENT '备注'")
    private String memo;

    @ApiModelProperty(value = "类型")
    @Column(name = "type", columnDefinition = "varchar(255) COMMENT '类型'")
    private String type;


}
